<a name="view"></a>
<div class="attachment-image" id="attachment-<?php echo $post->ID; ?>">
	<?php if(!empty($post->ptitle)) {?>
	<p class="imeta">
		<a href="<?php echo $this->url('post', $post->parent); ?>">&larr;回到《<?php echo $post->ptitle; ?>》</a>
	</p>
	<?php }?>
	<?php if(!empty($post->file)) { ?>
	<?php
	$file = $post->file;
	$p = pathinfo($file);
	$path = $this->setting->upload_url_path . '/' . $p['dirname'] . '/';
	$file = $p['basename'];
	if(isset($post->meta) && isset($post->meta['sizes']) && isset($post->meta['sizes']['medium'])){
		$file = $post->meta['sizes']['medium']['file'];
	}
	?>
	<a href="<?php echo $this->setting->upload_url_path . '/' . $post->meta['file']; ?>" target="_blank"><img title="点击查看原图" src="<?php echo $path . $file; ?>" /></a>
	<?php } else { ?>
	<p class="error">该图片无法查看，或者已经被删除了！</p>
	<?php } ?>
	<p class="nav">
		<?php if(!empty($post->previous)) echo "<a href=\"".$post->previous->url."#view\" title=\"".$post->previous->title."\">&larr; 上一张</a>"; else echo "<span>已经是第一张了</span>"; ?>
		&nbsp;&nbsp;
		<?php if(!empty($post->next)) echo "<a href=\"".$post->next->url."#view\" title=\"".$post->next->title."\">下一张 &rarr;</a>"; else echo "<span>已经是最后一张了</span>"; ?>
	</p>
</div>